package com.mixsmart.core.test.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mixsmart.core.log.ILog;
import com.mixsmart.core.log.ILogBean;
import com.mixsmart.core.service.impl.MgrService;
import com.mixsmart.core.test.entity.TLogBean;

@Service
public class LogService extends MgrService<TLogBean, String> implements ILog {
	
	@Override
	@Transactional(propagation=Propagation.SUPPORTS)
	public boolean saveLog(ILogBean logBean) throws Exception {
		boolean is = false;
		is = super.saveObj(logBean);
		return is;
	}

	@Override
	public String getLogName() {
		return "测试";
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	public void saveTest() {
		TLogBean logBEan = new TLogBean();
		logBEan.setId("test-tr-2");
		logBEan.setName("测试");
		logBEan.setRemark("测试在中");
		save(logBEan);
	}
	
}
